package org.example.dao;

import org.example.pojo.Label;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;

public interface LabelDao extends JpaRepository<Label, String>, JpaSpecificationExecutor<Label> {
    /**
     * 判断删除的状态
     * @param id
     * @return
     */
    @Modifying
    int deleteOneById(String id);

    /**
     * 根据id查找标签
     * @param labelId
     * @return
     */
    Label findOneById(String id);

    Label findOneByName(String name);
}
